#pragma once
#include "const.h"
#include <iostream>
#include <boost\asio.hpp>
class MsgNode
{
	
public:
	MsgNode(short max_len) :_total_size(max_len), _cur_size(0) {
		_data = new char[_total_size];
		memset(_data, 0, _total_size);
	}	
	~MsgNode() {
		std::cout << "~MsgNode()" << std::endl;
		delete[] _data;
	}
	void Clear() {
		memset(_data, 0, _total_size);
		_cur_size = 0;
	}

public:
	char* _data;
	short _cur_size;
	short _total_size;
};

class RecvNode :public MsgNode {
	friend class LogicSys;
public:
	RecvNode(short max_len, short msg_id);
private:
	short _msg_id;
};

class SendNode :public MsgNode {
public:
	SendNode(const char* data, short max_len, short msg_id);
private:
	short _msg_id;
};

